//
//  Base64.m
//  jPush
//
//  Created by shaneZhang on 15/5/25.
//  Copyright (c) 2015年 shaneZhang. All rights reserved.
//

#import "Base64.h"
#import "GTMBase64.h"

@implementation Base64
+(NSString *)stringByBase64String:(NSString *)base64String
{
    NSString *sourceString = [[NSString alloc] initWithData:[GTMBase64 decodeData:[base64String dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:NO]] encoding:NSUTF8StringEncoding];
    return sourceString;
}

/// Returns:
// A new autoreleased Base64 encoded NSString with NSString
+(NSString *)base64StringBystring:(NSString *)string
{
    NSString *base64String = [[NSString alloc] initWithData:[GTMBase64 encodeData:[string dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:NO]] encoding:NSUTF8StringEncoding];
    return base64String;
}
@end
